<?php
/**
 * | ---------------------------------------------------------------------------------------------------
 * | ProjectName: mvc
 * | ---------------------------------------------------------------------------------------------------
 * | Author：johnxu <fsyzxz@163.com>
 * | ---------------------------------------------------------------------------------------------------
 * | Home: https://www.xfjpeter.cn
 * | ---------------------------------------------------------------------------------------------------
 * | Data: 201907202019-07-20
 * | ---------------------------------------------------------------------------------------------------
 * | Desc:
 * | ---------------------------------------------------------------------------------------------------
 */

namespace app\common\validate;

use think\Validate;

class Role extends Validate
{
    protected $rule = [
        'name'        => 'require|unique:role,name',
        'description' => 'require',
    ];

    protected $message = [
        'name.require'        => '请输入角色名称',
        'name.unique'         => '角色名称已经存在',
        'description.require' => '请输入角色描述',
    ];

    protected $scene = [
        'add' => ['name', 'description'],
    ];
}